/**
 * @author lk
 * @date 2022/5/15 19:44
 */
package com.two.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestController {

    @RequestMapping(
            value = {"/", "/test"}
    )
    public String index() {
        return "index";
    }

    @PutMapping("/form")
    public String target() {
        return "target";
    }

    @RequestMapping(value = "/params")
    public String params() {
        return "params";
    }

    private Integer counts = 0;

    @GetMapping("/user/{id}")
    public String placeholder(@PathVariable("id") Integer id) {
        System.out.println(id);
        System.out.println(counts);
        counts++;
        return "target";
    }


}
